from datetime import date

from django.test import TestCase
import os

import django
os.environ.setdefault('DJANGO_SETTINGS_MODULE','demo01.settings')
django.setup()

from app_models.models import BookInfo,HeroInfo
# books = BookInfo.objects.all()
# books = BookInfo.objects.filter(btitle='天龙八部')
# print(books.query)
# print(books)
# book = BookInfo(
#     btitle='西游记',
#     bpub_date=date(1988, 1, 1),
#     bread=10,
#     bcomment=10
# )
# book.save()
# print(book)

books = BookInfo.objects.exclude(id=1)
print(books.query)
print(books)
books = BookInfo.objects.exclude(id=1)
print(books)
for book in books:
    print(book)